package com.ruoyi.eam.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.eam.doman.EamLocation;
import com.ruoyi.eam.mapper.EamLocationMapper;
import com.ruoyi.eam.service.IEamLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 存放位置Service业务层处理
 *
 * @author ruoyi
 * @date 2024-06-18
 */
@Service
public class EamLocationServiceImpl implements IEamLocationService
{
    @Autowired
    private EamLocationMapper eamLocationMapper;

    /**
     * 查询存放位置
     *
     * @param locationId 存放位置主键
     * @return 存放位置
     */
    @Override
    public EamLocation selectEamLocationByLocationId(Long locationId)
    {
        return eamLocationMapper.selectEamLocationByLocationId(locationId);
    }

    /**
     * 查询存放位置列表
     *
     * @param eamLocation 存放位置
     * @return 存放位置
     */
    @Override
    public List<EamLocation> selectEamLocationList(EamLocation eamLocation)
    {
        return eamLocationMapper.selectEamLocationList(eamLocation);
    }

    /**
     * 新增存放位置
     *
     * @param eamLocation 存放位置
     * @return 结果
     */
    @Override
    public int insertEamLocation(EamLocation eamLocation)
    {
        eamLocation.setCreateTime(DateUtils.getNowDate());
        return eamLocationMapper.insertEamLocation(eamLocation);
    }

    /**
     * 修改存放位置
     *
     * @param eamLocation 存放位置
     * @return 结果
     */
    @Override
    public int updateEamLocation(EamLocation eamLocation)
    {
        return eamLocationMapper.updateEamLocation(eamLocation);
    }

    /**
     * 批量删除存放位置
     *
     * @param locationIds 需要删除的存放位置主键
     * @return 结果
     */
    @Override
    public int deleteEamLocationByLocationIds(Long[] locationIds)
    {
        return eamLocationMapper.deleteEamLocationByLocationIds(locationIds);
    }

    /**
     * 删除存放位置信息
     *
     * @param locationId 存放位置主键
     * @return 结果
     */
    @Override
    public int deleteEamLocationByLocationId(Long locationId)
    {
        return eamLocationMapper.deleteEamLocationByLocationId(locationId);
    }
}
